<template>
  <div>
    <!-- 导航区域 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/SystemHomePage' }"
        >首页</el-breadcrumb-item
      >
      <el-breadcrumb-item>通告信息</el-breadcrumb-item>
    </el-breadcrumb>
    <el-carousel :interval="4000" type="card" height="400px">
      <el-carousel-item v-for="(item, i) in HotHouse" :key="i">
        <img :src="item" alt="" />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>
<script>
export default {
  data() {
    return {
      queryInfo: {
        query: "",
        pageNum: 1, // 当前页数，默认为1
        pageSize: 5, // 每页显示数量
      },
      HotHouse: [],
      HotHouseName:[],
    };
  },
  created() {
    this.getpicture();
  },
  methods: {
    async getpicture() {
      const { data: result } = await this.$http.get("HouseList", {
        params: this.queryInfo,
      });
      this.houseList = result.data;
      let newArr = this.houseList.map((item) => item.picture);
      for (let i = 0; i < newArr.length; i++) {
        this.HotHouse.push(newArr[i]);
      }
      this.HotHouse = this.HotHouse.splice(0, 4);
    },
  },
};
</script>
<style>
.el-carousel {
  margin-top: 5%;
}
.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 400px;
  margin: 0;
}
.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}
.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
img{
    width: 100%;
    height: 100%;
}
</style>